//
//  YJNetMonitor.h
//  Cszy
//
//  Created by SC on 16/11/30.
//  Copyright © 2016年 SC. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Reachability.h"


@protocol YBMonitorNetWorkStateDelegate <NSObject>

@optional

/**
 * 当网络状态发生改变的时候触发， 前提是必须是添加网络状态监听
 */
- (void)netWorkStateChanged;

@end


@interface YJNetMonitor : NSObject

@property (nonatomic, strong) Reachability *conn;
@property (nonatomic, copy) NSString *startNetType;

@property (nonatomic, weak) id<YBMonitorNetWorkStateDelegate>delegate;


/**
 * 实例化单例对象
 */
+ (YJNetMonitor *)shareMonitorNetWorkState;


/**
 * 获取当前网络类型 GPRS / wifi / noConnect
 */
- (NSString *)getCurrentNetWorkType;


/**
 * 添加网络状态监听
 */
- (void)addMonitorNetWorkState;


/**
 * 获取网络状态
 * YES 有网络
 * NO  无网络
 */
- (BOOL)getNetWorkState;

@end
